package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.DataModule;
import com.ruoyi.system.domain.DataRule;
import com.ruoyi.system.service.DataRuleService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author tang ao long
 * @Date 2020-08-26 13:46
 * @Version 1.0
 */
@Controller
@RequestMapping("/system/DataRule")
public class SysDataRuleController extends BaseController {

    @Autowired
    private DataRuleService dataRuleService;

    /**
     * 查询数据模型格式信息
     * @param moduleId 查询对象id
     * @return 返回查询结果
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(String moduleId)
    {
        List<DataRule> dataModuleList = dataRuleService.selectDataRuleInfoList(moduleId);
        return getDataTable(dataModuleList);
    }

}
